package ca.ubc.icapture.genapha.forms;

import icapture.SQLMgr;
import icapture.beans.DB.Cohort;
import icapture.beans.DB.Gene;
import icapture.beans.DB.Phenotypes;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.validator.ValidatorForm;

public abstract class AnalysisFilesForm extends ValidatorForm
{
    private ArrayList<Cohort> cohorts;
    private String[] selectedCohort;
    private boolean removeDuplicateSubjects = true;
    private boolean removeMzTwins = true;
    private ArrayList<Phenotypes> phenotypes;
    private String selectedPhenotype;
    private ArrayList<Gene> availableGenes;
    private String[] selectedGenes;
    private String email;
    private String submitType;

    public AnalysisFilesForm()
    {
        super();
        setAvailableGenes(SQLMgr.getGenesNotInXChrom());
        setCohorts(SQLMgr.getCohorts());
    }

    @Override
    public void reset(ActionMapping mapping, HttpServletRequest request)
    {
        setSubmitType("");
    }

    @Override
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request)
    {
        return super.validate(mapping, request);
    }

    /**
     * @return the cohorts
     */
    public ArrayList<Cohort> getCohorts()
    {
        return cohorts;
    }

    /**
     * @param cohorts the cohorts to set
     */
    public void setCohorts(ArrayList<Cohort> cohorts)
    {
        this.cohorts = cohorts;
    }

    /**
     * @return the selectedCohort
     */
    public String[] getSelectedCohort()
    {
        return selectedCohort;
    }

    /**
     * @param selectedCohort the selectedCohort to set
     */
    public void setSelectedCohort(String[] selectedCohort)
    {
        this.selectedCohort = selectedCohort;
    }

    /**
     * @return the removeDuplicateSubjects
     */
    public boolean isRemoveDuplicateSubjects()
    {
        return removeDuplicateSubjects;
    }

    /**
     * @param removeDuplicateSubjects the removeDuplicateSubjects to set
     */
    public void setRemoveDuplicateSubjects(boolean removeDuplicateSubjects)
    {
        this.removeDuplicateSubjects = removeDuplicateSubjects;
    }

    /**
     * @return the removeMzTwins
     */
    public boolean isRemoveMzTwins()
    {
        return removeMzTwins;
    }

    /**
     * @param removeMzTwins the removeMzTwins to set
     */
    public void setRemoveMzTwins(boolean removeMzTwins)
    {
        this.removeMzTwins = removeMzTwins;
    }

    /**
     * @return the phenotypes
     */
    public ArrayList<Phenotypes> getPhenotypes()
    {
        return phenotypes;
    }

    /**
     * @param phenotypes the phenotypes to set
     */
    public void setPhenotypes(ArrayList<Phenotypes> phenotypes)
    {
        this.phenotypes = phenotypes;
    }

    /**
     * @return the selectedPhenotype
     */
    public String getSelectedPhenotype()
    {
        return selectedPhenotype;
    }

    /**
     * @param selectedPhenotype the selectedPhenotype to set
     */
    public void setSelectedPhenotype(String selectedPhenotype)
    {
        this.selectedPhenotype = selectedPhenotype;
    }

    /**
     * @return the availableGenes
     */
    public ArrayList<Gene> getAvailableGenes()
    {
        return availableGenes;
    }

    /**
     * @param availableGenes the availableGenes to set
     */
    public void setAvailableGenes(ArrayList<Gene> availableGenes)
    {
        this.availableGenes = availableGenes;
    }

    /**
     * @return the selectedGenes
     */
    public String[] getSelectedGenes()
    {
        return selectedGenes;
    }

    /**
     * @param selectedGenes the selectedGenes to set
     */
    public void setSelectedGenes(String[] selectedGenes)
    {
        this.selectedGenes = selectedGenes;
    }

    /**
     * @return the email
     */
    public String getEmail()
    {
        return email;
    }

    /**
     * @param email the email to set
     */
    public void setEmail(String email)
    {
        this.email = email;
    }

    /**
     * @return the submitType
     */
    public String getSubmitType()
    {
        return submitType;
    }

    /**
     * @param submitType the submitType to set
     */
    public void setSubmitType(String submitType)
    {
        this.submitType = submitType;
    }
}
